if(PkgConfig_FOUND)
    pkg_check_modules(sdl2 QUIET IMPORTED_TARGET sdl2)
    pkg_check_modules(sdl2_image QUIET IMPORTED_TARGET SDL2_image)
    set(packages PkgConfig::sdl2
        PkgConfig::sdl2_image)
endif()

if(sdl2_FOUND)
    build_all_target(${packages})
else()
    get_filename_component(CURRENT_DIR_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
    message(STATUS "${packages} not found! Skipping ${CURRENT_DIR_NAME}")
endif()
